//
//  MyPushViewController.m
//  test1
//
//  Created by chen on 16/11/1.
//  Copyright © 2016年 chen. All rights reserved.
//

#import "MyPushViewController.h"
#import <WebKit/WebKit.h>

@interface MyPushViewController () <WKUIDelegate,WKNavigationDelegate>

@property(nonatomic,weak)WKWebView *webView;

@end

@implementation MyPushViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    CGRect rect = self.view.bounds;
    rect.origin.y -= 44;
    rect.size.height += 44;
    WKWebView *wkWeb = [[WKWebView alloc]initWithFrame:rect];
    [self.view addSubview:wkWeb];
    self.webView = wkWeb;
    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:self.urlString]]];
}

-(void)setUrlString:(NSString *)urlString {
    _urlString = urlString;
    [self setupUIWithUrl:urlString];
}

- (void)setupUIWithUrl:(NSString *)urlString {

    
    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:urlString]]];
    
    NSLog(@"%@",urlString);
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
